<template>
  <div class="tage">
    <el-form-item label-width="120px" label="题目标签：">
      <el-select
        v-model="tags"
        multiple
        allow-create
        placeholder="请选择"
        style="width: 100%"
        @change="changes"
      >
        <el-option
          :label="item.tagName"
          :value="item.tagName"
          v-for="(item, i) in tagts"
          :key="i"
        >
        </el-option>
      </el-select>
    </el-form-item>
  </div>
</template>

<script>
import { list } from '@/api/hmmm/tags.js'
export default {
  name: 'Tage',
  data() {
    return {
      tags: '',
      tagts: []
    }
  },
  created() {
    this.gettags()
  },
  methods: {
    async gettags() {
      try {
        const { data } = await list()
        console.log(data)
        this.tagts = data.items
      } catch (err) {}
    },
    changes() {
      this.$emit('tage', this.tags)
    }
  }
}
</script>

<style lang="less" scoped></style>
